using Gtk;

public class MainWindowApp: GLib.Object{
	public Gtk.Window mainWindow;
	public Builder builder;
	private const string UI = "mainwindow.glade";


//构造函数
	construct{
		builder = new Builder();
		try{
			builder.add_from_file(UI);
			mainWindow = builder.get_object("main_window") as Gtk.Window;
		}catch(Error e){
			stderr.printf("Could not load UI: %s\n", e.message);
			return;
		}
		mainWindow.set_default_size(300,200);
		//mainWindow.set_size_quest(400,300);
		mainWindow.title = "NanoHub";
		mainWindow.window_position = WindowPosition.CENTER;
		mainWindow.destroy.connect(Gtk.main_quit);
		builder.connect_signals(this);


	}



}

class NanoHubApp: GLib.Object{
	public static int main(string[] args){
		Gtk.init(ref args);
		var app = new MainWindowApp();
		app.mainWindow.show_all();
		Gtk.main();
		return 0;
	}
}
